package cn.wolfcode.education.query;

import cn.wolfcode.education.util.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Setter
@Getter
public class ClientQuery extends QueryObject {

    private String keyword;

    private String clientName;// 高级查询条件,姓名

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date beginTime; // 录入开始时间

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime; // 录入结束时间

    private Integer minAge; // 年龄
    private Integer maxAge; // 年龄
    private Integer gender; // 性别

    private Integer wishLevel; // 意向等级
    private Integer wishCampus; // 意向校区
    private Integer wishClass; // 意向班级
    private Integer wishSubject; // 意向学科

    public Date getEndTime() {
        return this.endTime == null ? null : DateUtil.getEndDate(this.endTime);
    }


    /*public String getKeyword() {
        return this.keyword.trim().length() > 0 ? this.keyword.trim() : null;
    }*/

}

